home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
icon
/
packages.lha
/
packages
/
atari
/
ats.arc
/
STAND.ARC
/
BTREES.U1
< prev
next >
Wrap
Text File
|
1990-03-28
|
3KB
|
317 lines
proc main
local 0,000020,line
local 1,000020,tree
local 2,000000,read
local 3,000000,tform
local 4,000000,write
local 5,000000,walk
local 6,000000,leaves
con 0,010000,9,164,162,145,145,040,167,141,154,153
con 1,010000,6,154,145,141,166,145,163
declend
filen btrees.icn
line 11
mark L1
lab L2
mark0
pnull
var 0
var 2
pnull
line 13
invoke 1
asgn
unmark
mark L2
mark L5
pnull
var 1
var 3
var 0
line 14
invoke 1
asgn
unmark
lab L5
mark L6
var 4
str 0
line 15
invoke 1
unmark
lab L6
mark L7
mark0
var 4
var 5
var 1
line 16
invoke 1
invoke 1
pop
lab L8
efail
lab L9
unmark
lab L7
mark L10
var 4
str 1
line 17
invoke 1
unmark
lab L10
mark0
var 4
var 6
var 1
line 18
invoke 1
invoke 1
pop
lab L11
efail
lab L12
lab L3
unmark
goto L2
lab L4
unmark
lab L1
pnull
line 20
pfail
end
proc tform
local 0,001000,s
local 1,000020,value
local 2,000020,left
local 3,000020,right
local 4,000000,tab
local 5,000000,upto
local 6,000000,move
local 7,000000,bal
local 8,000000,node
local 9,000000,tform
con 0,020000,1,050
con 1,002000,1,1
con 2,020000,1,054
con 3,020000,1,051
declend
line 22
mark L1
mark0
pnull
var 0
line 24
null
unmark
mark L2
pnull
pret
lab L2
pfail
unmark
lab L1
mark L3
var 0
line 25
bscan
mark L4
pnull
var 1
var 4
var 5
cset 0
invoke 1
invoke 1
asgn
unmark
mark L6
var 6
int 1
line 26
invoke 1
unmark
lab L6
mark L7
pnull
var 2
var 4
var 7
cset 2
line 27
invoke 1
invoke 1
asgn
unmark
lab L7
mark L8
var 6
int 1
line 28
invoke 1
unmark
lab L8
mark L9
pnull
var 3
var 4
var 7
cset 3
line 29
invoke 1
invoke 1
asgn
unmark
lab L9
mark L10
var 8
var 1
var 9
var 2
line 30
invoke 1
var 9
var 3
invoke 1
invoke 3
pret
lab L10
pfail
goto L5
lab L4
mark L11
var 8
var 0
line 32
invoke 1
pret
lab L11
pfail
lab L5
line 25
escan
unmark
lab L3
pnull
line 33
pfail
end
proc walk
local 0,001000,t
local 1,000000,walk
declend
line 35
mark L1
mark0
var 1
mark L4
pnull
pnull
var 0
line 36
field ltree
nonnull
esusp
goto L5
lab L4
pnull
pnull
var 0
field rtree
nonnull
lab L5
invoke 1
psusp
pop
lab L2
efail
lab L3
unmark
lab L1
mark L6
mark L7
pnull
var 0
line 37
field data
pret
lab L7
pfail
unmark
lab L6
pnull
line 38
pfail
end
proc leaves
local 0,001000,t
local 1,000000,leaves
declend
line 40
mark L1
mark0
mark L2
mark L3
pnull
pnull
var 0
line 41
field ltree
nonnull
esusp
goto L4
lab L3
pnull
pnull
var 0
field rtree
nonnull
lab L4
unmark
efail
lab L2
pnull
unmark
mark L5
pnull
var 0
field data
pret
lab L5
pfail
unmark
lab L1
mark L6
mark0
var 1
mark L9
pnull
pnull
var 0
line 42
field ltree
nonnull
esusp
goto L10
lab L9
pnull
pnull
var 0
field rtree
nonnull
lab L10
invoke 1
psusp
pop
lab L7
efail
lab L8
unmark
lab L6
pnull
line 43
pfail
end